#include("./layout.html")
#include("./_include.html")
#include("_sidebar.html")
#@layout()

#define script()
#@sidebarResource()
#end

#define content()
<div class="col-md-8 col-lg-8 col-xl-9 #(option('whimurmur_sidebar_position') == 'left' ? 'offset-md-4 offset-lg-4 offset-xl-3 cl-right' : 'cl-left')">
    #set(page=C.request.getParameter('page'))
    #if(page == null)
        #set(page = 1)
    #end
    
    <h2 class="cl-artical-title pt-0">这里是网站的所有文章</h2>
    
    #articlePageEx(page=page, pageSize=50)
        #for(article : articlePageEx.list)
        <div class="cl-card bg-light">
            <a class="card-link" href="#(article.url)" target="#(option('whimurmur_link_to_blank') && article.linkTo ? '_blank' : '_self')">
                <div class="row">
    
                    <div class="col-lg-9 col-md-8 col-sm-12 cl-card-main bg-light">
                        <h3 class="cl-card-main-title">
                           #(article.title)
                        </h3>
                        <p class="cl-card-more">#(article.user.nickname ??) 发布于 #date(article.created ?? article.modified, "yyyy年MM月dd日 HH时")
                            &nbsp;|&nbsp;
                            #articleCategories(article.getId(), 'category')
                                分类：
                                #for(category: categories)
                                    #(category.title ??)
                                #end
                            #end
                            &nbsp;|&nbsp;
                            #articleCategories(article.getId(), 'tag')
                                标签：
                                #for(category: categories)
                                    #(category.title ??)
                                    #if(for.size != for.count)
                                        &nbsp;/&nbsp;
                                    #end
                                #end
                            #end
                        </p>
                    </div>
                </div>
            </a>
        </div>
        #end
        
        #articlePaginateEx(firstGotoIndex=false)
        <nav aria-label="">
            <ul class="pagination justify-content-center">
                #for(page : pages)
                <li class="page-item #(page.style)"><a class="page-link" href="#(page.url.replace('-', '?page='))">#(page.text)</a></li>
                #end
            </ul>
        </nav>
        #end
    #end

</div>

<div class="col-md-4 col-lg-4 col-xl-3 #(option('whimurmur_sidebar_position') == 'left' ? 'offset-mdn-8 offset-lgn-8 offset-xln-9 offset-smn-0 cl-left' : 'cl-right')">
    #@sidebarContent()
</div>
#end